#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
	int count = 0;
	int n = 0;
	for (int i = 1;i <= 2019;i++)
	{
		int num = i;
		if (num % 10 == 9 )
		{
			count++;
			break;
		}
		else {
			num /= 10;
		}
	
	}
	printf("%d", count);
	return 0;
}